﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;

namespace FruitWeigher
{
    public struct ItemInfo
    {
        public int Type;
        public int Heft;
    }
	public partial class UIItem0 : UserControl
	{
		public UIItem0()
		{
			// 为初始化变量所必需
			InitializeComponent();
            iteminfo.Heft = 0;
            iteminfo.Type = 1;
		}
        public ItemInfo iteminfo;
        public int Heft
        {
            get { return iteminfo.Heft; }
            set
            {
                iteminfo.Heft = value;
            }
        }


        public int Type
        {
            get { return iteminfo.Type; }
            set 
            {
                iteminfo.Type = value;
                ItemImage.Source = new BitmapImage(new Uri(@"/FruitWeigher;Component/Images/" + value + ".png", UriKind.Relative));
                //switch (value)
                //{
                //    case 0:
                //        break;
                //    case 1:                        
                //        break;
                //    case 2:
                //        break;
                //    case 3:
                //        break;
                //    case 4:
                //        break;
                //    case 5:
                //        break;
                //}
            }
        }

	}
}